from typing import List


class Solution:
    def minOperations(self, nums: List[int], x: int) -> int:
        l = len(nums)
        front = 0
        end = l
        sum = 0
        while end > front:
            if nums[front] > nums[]
            if nums[front] > nums[end]:
                if nums[front]>x:
                    if sum ==0:
                        return -1

                    if nums[end] <x:

                if x >= nums[front]:
                    x -= nums[front]
                    sum +=1
                    if x ==0:
                        return sum
            elif nums[end] > nums[front]:
                if nums[end] > x:
                    if sum == 0:
                        return -1
                    if nums[end]
                if x >= nums[front]:
                    x -= nums[front]
                    sum += 1
                    if x == 0:
                        return sum



if __name__ == '__main__':
    nums = 5
    x = [1,1,4,2,3]
    solution = Solution()
    val =solution.minOperations(nums,x)
    print(val)

